trigger AptiIntegration_Onlead on Lead (after update) {
	set<string> aptiIdStatusDetail = new set<string>();
	for(Lead tempLead : Trigger.new) {
		if(tempLead.APTI_ID__c != null) {
			if(tempLead.Push_Lead__c && Trigger.oldMap.get(tempLead.id).Push_Lead__c == false) {
				aptiIdStatusDetail.add(tempLead.Id + '-'+ tempLead.APTI_ID__c +'+' + 'PUSHED');//tempLead.Status_Detail__c );
			}
			else if(tempLead.Hot_Transfer__c && Trigger.oldMap.get(tempLead.id).Hot_Transfer__c == false) {
				aptiIdStatusDetail.add(tempLead.Id + '-'+ tempLead.APTI_ID__c +'+' + 'XFER');//tempLead.Status_Detail__c );
			}
			else if(tempLead.Status_Detail_APTI__c != Trigger.oldMap.get(tempLead.id).Status_Detail_APTI__c ) {
				if(tempLead.Status == 'Declined' || tempLead.Status == 'No Further Action') {
					aptiIdStatusDetail.add(tempLead.Id + '-'+ tempLead.APTI_ID__c + '+' + tempLead.Status_Detail_APTI__c );
				}
			} 
		}		
	}
	
	if(aptiIdStatusDetail.size() !=0)
		AptiIntegration_DataMap.doCallOutAptiService(aptiIdStatusDetail);
}